package com.hsc.yalebao.tools;

import android.os.Environment;
import android.os.StatFs;
import java.io.File;

public class MemorySpaceCheck
{
  public static long getAvailableSize(String paramString)
  {
    StatFs localStatFs = new StatFs(paramString);
    localStatFs.restat(paramString);
    return localStatFs.getAvailableBlocks() * localStatFs.getBlockSize();
  }

  public static long getSDAvailableSize()
  {
    if (Environment.getExternalStorageState().equals("mounted"))
      return getAvailableSize(Environment.getExternalStorageDirectory().toString());
    return 0L;
  }

  public static long getSDTotalSize()
  {
    if (Environment.getExternalStorageState().equals("mounted"))
      return getTotalSize(Environment.getExternalStorageDirectory().toString());
    return 0L;
  }

  public static long getSysTotalSize()
  {
    return getTotalSize("/data");
  }

  public static long getSystemAvailableSize()
  {
    return getAvailableSize("/data");
  }

  public static long getTotalSize(String paramString)
  {
    StatFs localStatFs = new StatFs(paramString);
    localStatFs.restat(paramString);
    return localStatFs.getBlockCount() * localStatFs.getBlockSize();
  }

  public static boolean hasEnoughMemory(String paramString)
  {
    long l = new File(paramString).length();
    if ((paramString.startsWith("/sdcard")) || (paramString.startsWith("/mnt/sdcard")))
      if (getSDAvailableSize() <= l);
    while (getSystemAvailableSize() > l)
    {
      return true;
      return false;
    }
    return false;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tools.MemorySpaceCheck
 * JD-Core Version:    0.6.2
 */